def factorial(n):
    if n <= 1:
        return n
    else:
        return n*factorial(n-1)

def climb_stairs(n):
    if n<=2:
        return n
    s=[1,2]
    for i in range(3,n+1):
        s[0],s[1]=s[1],s[0]+s[1]
    return s[1]

class TreeNode:
    def __init__(self,x):
        self.val=x
        self.left=None
        self.right=None
def diff_tree(a,b):
    if not a and not b:
        return True
    elif not a or not b:
        return False
    return a.val==b.val and diff_tree(a.left,b.left) and diff_tree(a.right,b.right)

def judge_sum(array,target,count):
    results=[]
    if not array:
        return results
    if count == 1 and target in array:
        return [[target]]
    elif count == 1 and target not in array:
        return results
    t1=judge_sum(array[1:],target-array[0],count-1)
    t2=judge_sum(array[1:],target,count)
    if t1:
        for i in range(len(t1)):
            t=[array[0]]
            t+=t1[i]
            results.append(t)
    if t2:
        for j in range(len(t2)):
            results.append(t2[j])
    results=[ list(result) for result in list(set([ tuple(sorted(result)) for result in results ])) ]
    return results
